package com.hog.enums;

/**
 * 双色球规则枚举类
 *
 * @author 唐晴
 * @date 2020/12/23
 */
public enum SsqRuleEnum {
    PRIZE_1("6+1", "一等奖: 发财了"),
    PRIZE_2("6+0", "二等奖: 发财了"),
    PRIZE_3("5+1", "三等奖: 奖金3000"),
    PRIZE_4("5+0", "四等奖: 奖金200"),
    PRIZE_4_1("4+1", "四等奖: 奖金200"),
    PRIZE_5("4+0", "五等奖: 奖金10"),
    PRIZE_5_1("3+1", "五等奖: 奖金10"),
    PRIZE_6("2+1", "六等奖: 奖金5"),
    PRIZE_6_1("1+1", "六等奖: 奖金5"),
    PRIZE_6_2("0+1", "六等奖: 奖金5"),;

    private String rule;
    private String prizeName;

    SsqRuleEnum(String rule, String prizeName) {
        this.rule = rule;
        this.prizeName = prizeName;
    }

    public static String getPrizeNameByRule(String rule) {
        SsqRuleEnum[] values = SsqRuleEnum.values();
        for (SsqRuleEnum ruleEnum : values) {
            if (ruleEnum.getRule().equals(rule)) {
                return ruleEnum.getPrizeName();
            }
        }

        return "未中奖, 加油!";
    }

    public String getRule() {
        return rule;
    }

    public void setRule(String rule) {
        this.rule = rule;
    }

    public String getPrizeName() {
        return prizeName;
    }

    public void setPrizeName(String prizeName) {
        this.prizeName = prizeName;
    }
}
